#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <limits.h>
#define OJ_TEST 0
#define LOCAL_TEST 0

#define M 901

static int max(int a, int b){ return a>b?a:b; }
static int min(int a, int b) { return a<b?a:b; }

static char buff[1024];
static void solve(void){
	int i, not_in_word;
	int wc;
	while(fgets(buff, 1024, stdin)){
		wc = 0;
		not_in_word = 1;
		for(i=0; buff[i]; ++i){
			if(isalpha(buff[i])){
				if(not_in_word){
					++wc; not_in_word=0;
				}
			}else{
				not_in_word = 1;
			}
		}
		printf("%d\n", wc);
	}
}
#if OJ_TEST
	int main(int ac, char *av[]){
		solve();
		return 0;
	}
#elif  LOCAL_TEST
	void run(void){
		solve();
	}

#else

#endif
